//
//  PhotoPreviewView.swift
//  Kosspot
//
//  Created by 李鑫 on 2025/7/10.
//

import SwiftUI

struct PhotoPreviewView: View {
    let images: [String]
    @Binding var currentIndex: Int
    @Environment(\.dismiss) var dismiss
    @State private var scale: CGFloat = 1.0
    @State private var offset: CGSize = .zero
    
    var body: some View {
        ZStack {
            Color.black.ignoresSafeArea()
            
            TabView(selection: $currentIndex) {
                ForEach(0..<images.count, id: \.self) { index in
                    ZoomableImageView(url: images[index])
                        .tag(index)
                }
            }
            .tabViewStyle(.page(indexDisplayMode: .always))
            
            VStack {
                HStack {
                    Button(action: { dismiss() }) {
                        Image(systemName: "xmark")
                            .foregroundColor(.white)
                            .padding()
                    }
                    Spacer()
                }
                Spacer()
            }
        }
    }
}


//#Preview {
//    PhotoPreviewView()
//}
